package com.tw.wechart2.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

public class RelativeLayout2 extends RelativeLayout {

    // 是否拦截事件
    private boolean isInterceptAction = false;

    public RelativeLayout2(Context context) {
        super(context);
    }

    public RelativeLayout2(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public RelativeLayout2(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        return super.dispatchTouchEvent(ev);
    }

//    @Override
//    public boolean onInterceptTouchEvent(MotionEvent ev) {
//        return isInterceptAction;
//    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return super.onTouchEvent(event);
    }

    /**
     * @Description: 设置是否拦截事件(默认不拦截)
     * @Author: lanteng 2020/9/21
     * @return
     */
    public void setInterceptAction(boolean isInterceptAction) {
        this.isInterceptAction = isInterceptAction;
    }

}
